<template>
    <div class="soseplan">
        <el-card shadow="always">
            <div slot="header">
                <span :style="{ fontFamily: '微软雅黑', fontSize: '16px', fontWeight: 'bold' }">薪资调整</span>
            </div>
            <div class="card-body">
                <div>
                    <el-button type="primary" size="default">调薪</el-button>
                    <el-button type="primary" size="default" plain
                        :style="{ background: '#fff', color: '#409eff' }">删除</el-button>
                </div>
                <div class="tablearea">
                    <el-table ref="multipleTable" :data="tableData2" stripe
                    :header-cell-style="{ background: '#f5f7f9', borderTop: '1px solid #ebeef5', textAlign: 'center' }"
                    :cell-style="{ textAlign: 'center' }" style="width: 100%">
                    <el-table-column type="selection" width="60">
                    </el-table-column>
                    <el-table-column type="index" label="序号" width="60" fixed>
                    </el-table-column>
                    <el-table-column label="姓名" width="100" fixed>
                        <template slot-scope="scope">
                            <div>
                                <el-button type="text" size="default">{{ scope.row.name }}</el-button>

                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="bumen" label="部门" width="120">
                    </el-table-column>
                    <el-table-column prop="zhiwei" label="岗位" width="120">
                    </el-table-column>
                    <el-table-column prop="tel" label="手机号" width="200">
                    </el-table-column>
                    <el-table-column prop="gonghao" label="工号" width="200">
                    </el-table-column>
                    <el-table-column prop="zhengjian" label="证件号" width="200">
                    </el-table-column>
                    <el-table-column prop="gongzuoxingzhi" label="工作性质" width="120">
                    </el-table-column>
                    <el-table-column prop="status" label="状态" width="120">
                    </el-table-column>
                    <el-table-column prop="type" label="类型" width="120">
                    </el-table-column>
                    <el-table-column prop="reason" label="调整原因" width="120">
                    </el-table-column>
                    <el-table-column prop="shengxiaoriqi" label="生效日期" width="120">
                    </el-table-column>
                    <el-table-column prop="shengxiaostatus" label="生效状态" width="120">
                    </el-table-column>
                    <el-table-column prop="taiozhengqian" label="调整前工资" width="150">
                    </el-table-column>
                    <el-table-column prop="tiaozhenghou" label="调整后工资" width="150">
                    </el-table-column>
                    <el-table-column prop="handletime" label="操作时间" width="180">
                    </el-table-column>
                    <el-table-column label="操作" fixed="right" width="120">
                        <template>
                            <div>
                                <el-button type="text" size="default">详情</el-button>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                </div>
            </div>
            <el-row>
                <el-col :span="24" :style="{ textAlign: 'right' }">
                    <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="currentPage4" layout="total, prev, pager, next" :total="6">
                    </el-pagination>
                </el-col>
            </el-row>
        </el-card>
    </div>
</template>
<script>
export default {
    name: '',
    components: {

    },
    mixins: [],
    props: {

    },
    data() {
        return {
            currentPage4: 1,
            multipleSelection: [],
            tableData2: [
                {
                    id: 1,
                    name: '莫俏丽',
                    bumen: '项目部',
                    zhiwei: '项目经理',
                    tel: 13714046148,
                    gonghao: 'GH2022011005',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'全职',
                    status: '待离职',
                    type:'调薪',
                    reason:'晋升',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"未生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 2,
                    name: '令云心',
                    bumen: '产品部',
                    zhiwei: '项目经理',
                    tel: 19893995896,
                    gonghao: 'GH2022011006',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'实习生',
                    status: '试用',
                    type:'转正',
                    reason:'转正',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 3,
                    name: '堂安春',
                    bumen: '人力资源部',
                    zhiwei: '项目经理',
                    tel: 15083709763,
                    gonghao: 'GH2021011007',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'兼职',
                    status: '试用',
                    type:'定薪',
                    reason:'入职定薪',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"未生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 4,
                    name: '笃水瑶',
                    bumen: '设计部',
                    zhiwei: '项目经理',
                    tel: 15053222627,
                    gonghao: 'GH2021011008',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'外包',
                    status: '已离职',
                    type:'调薪',
                    reason:'调动',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"未生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 5,
                    name: '野依云',
                    bumen: '财务部',
                    zhiwei: '项目经理',
                    tel: 13669997085,
                    gonghao: 'GH2021011009',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'全职',
                    status: '正式',
                    type:'转正',
                    reason:'年终调薪',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"未生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 6,
                    name: '戈元冬',
                    bumen: '销售部',
                    zhiwei: '项目经理',
                    tel: 15080525797,
                    gonghao: 'GH2020011010',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'劳务派遣',
                    status: '试用',
                    type:'定薪',
                    reason:'调动',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 7,
                    name: '闽飞昂',
                    bumen: '行政部',
                    zhiwei: '项目经理',
                    tel: 17882152912,
                    gonghao: 'GH2020011011',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'全职',
                    status: '正式',
                    type:'调薪',
                    reason:'年终调薪',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 8,
                    name: '闾丘易文',
                    bumen: '人力资源部',
                    zhiwei: '项目经理',
                    tel: 15725901968,
                    gonghao: 'GH2019011012',
                    zhengjian: 'SFZ20213544',
                    emptype: '正式',
                    gongzuoxingzhi:'全职',
                    status: '正式',
                    type:'定薪',
                    reason:'晋升',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已经生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 9,
                    name: '曲嘉祥',
                    bumen: '财务部',
                    zhiwei: '项目经理',
                    tel: 13815204688,
                    gonghao: 'GH2019011013',
                    zhengjian: 'SFZ20213544',
                    emptype: '试用',
                    gongzuoxingzhi:'全职',
                    status: '正式',
                    type:'定薪',
                    reason:'晋升',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已经生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                }, {
                    id: 10,
                    name: '连昌',
                    bumen: '销售部',
                    zhiwei: '项目经理',
                    tel: 15286179282,
                    gonghao: 'GH2019011014',
                    zhengjian: 'SFZ20213544',
                    emptype: '试用',
                    gongzuoxingzhi:'全职',
                    status: '正式',
                    type:'定薪',
                    reason:'晋升',
                    shengxiaoriqi:'2020-06-07',
                    shengxiaostatus:"已经生效",
                    taiozhengqian: '8000.00',
                    tiaozhenghou: '14500.00',
                    handletime:'2022-12-06 15:20:10',
                    zuosh: '2022-05',
                    zhuanzheng: '2022-08',
                    lizhi: '2023-11',
                    desc:'',
                },
            ],
        }
    },
    computed: {

    },
    watch: {

    },
    mounted() {
        this.tableDataShow = this.tableData1
    },
    methods: {
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        },
        delinfo(row) {
            if (row.status == 1) {
                this.$message({
                    showClose: true,
                    message: '使用中方案，不可删除！',
                    type: 'error'
                });
            }
            this.$message({
                showClose: true,
                message: '方案未使用，删除成功',
                type: 'success'
            });
        },
        resetForm(formName) {
            this.$refs.form.resetFields();
            this.tableDataShow = this.tableData1
        },
        chaxun() {
            if (this.form.keyword) {
                let keyword = this.form.keyword
                console.log(keyword[0]);
                if (keyword[0] == 'G') {
                    this.tableDataShow = this.tableData1.filter(item => item.gonghao === keyword)
                } else if (keyword[0] == 'S') {
                    this.tableDataShow = this.tableData1.filter(item => item.zhengjian === keyword)
                } else if (keyword[0] == '1') {
                    this.tableDataShow = this.tableData1.filter(item => item.tel === parseInt(keyword))
                } else {
                    console.log(keyword);
                    this.tableDataShow = this.tableData1.filter(item => item.name === keyword)
                }
            } else if (this.form.bumen) {
                this.tableDataShow = this.tableData1.filter(item => item.bumen === this.form.bumen)
            } else if (this.form.type) {
                this.tableDataShow = this.tableData1.filter(item => item.emptype === this.form.type)
            }
        },
        dialogClose() {
            this.dialogLinkVisible = false;
            this.tableDataShow = this.tableData1;
            this.$refs.form.resetFields();
        },
        changeStatus(row) {
            const idx = this.tableData.findIndex(item => item.id === row.id)
            let status = this.tableData[idx].status
            if (status == 1) {
                this.tableData[idx].status = 0
            } else {
                this.tableData[idx].status = 1
            }
        }
    }
};
</script>
<style lang='less'>
.soseplan {
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    .el-card {
        width: 100%;

        .card-body {
            width: 100%;

            .tablearea {
                width: 100%;

                .el-table {
                    width: 100%;
                    margin: 20px 0;

                    .handle {
                        width: 100%;
                        display: flex;
                        justify-content: space-around;
                        align-items: center;
                    }
                }
            }

            .el-table::before {
                height: 0;
            }
        }
    }

    .el-dialog {
        width: 60%;
    }

    .el-dialog__body {
        padding: 10px 20px;

        .el-table {
            margin-bottom: 15px;
        }
    }
}
</style>